package com.landgroup.hradmin.mq;

import javax.annotation.Resource;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;

import org.apache.log4j.Logger;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.ProducerCallback;


public class Productor {
	private static Logger log = Logger.getLogger(Productor.class);
	@Resource
	private JmsTemplate jmsQueueTemplate;
	@Resource
	private JmsTemplate jmsTopicTemplate;
	
	public void sendMsg(String msg){
		log.info("start send msg ... ["+msg+"]");
		jmsQueueTemplate.convertAndSend(msg);

	}
	public void pubTopic(String msg){
		log.info("start pub msg ... ["+msg+"]");
		jmsTopicTemplate.convertAndSend(msg);
	}
	
	
	public JmsTemplate getJmsQueueTemplate() {
		return jmsQueueTemplate;
	}

	public void setJmsQueueTemplate(JmsTemplate jmsQueueTemplate) {
		this.jmsQueueTemplate = jmsQueueTemplate;
	}

	public JmsTemplate getJmsTopicTemplate() {
		return jmsTopicTemplate;
	}

	public void setJmsTopicTemplate(JmsTemplate jmsTopicTemplate) {
		this.jmsTopicTemplate = jmsTopicTemplate;
	}
	
}
